package org.lcx.pipeline.example;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;

/**
 * 测试而已
 */
public class PlatformTransactionManagerImpl implements PlatformTransactionManager {

/*
    private static Logger logger = LoggerFactory.getLogger(PlatformTransactionManagerImpl.class);
*/

    public PlatformTransactionManagerImpl() {
/*        System.out.println("@@[WARNING]: === this is an example txManager, that not bind any DataSource, and do nothing when commit and rollback!");
        System.out.println("@@[WARNING]: === org.lcx.pipeline.example.PlatformTransactionManagerImpl can not be used to Production Environment!! Just for demonstrate!");
        logger.error("\n\n===========如果你看到这行，说明你已经错误使用了本TransactionManager，这只是用来测试的，没有真正管理事务===========\n\n");
   */
    }

    @Override
    public TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException {
        return new TransactionStatusImpl();
    }

    @Override
    public void commit(TransactionStatus status) throws TransactionException {

    }

    @Override
    public void rollback(TransactionStatus status) throws TransactionException {

    }

}
